﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using HCMServices.DAO;
using HCMServices.DTO;
using System.Collections.Generic;

namespace HCMServices.Tests.TESTDAO
{
    /// <summary>
    /// Unit test for PlaceNameDAO class
    /// </summary>
    [TestClass]
    public class TestPlaceNameDAO
    {
        /// <summary>
        /// Unit test for Search() method in PlaceNameDAO class
        /// </summary>
        [TestMethod]
        public void TestSearch()
        {
            string connectString = "Data Source = isostore:/Database.sdf";

            PlaceNameDAO placeNameDao = new PlaceNameDAO(connectString);
            PlaceNameDTO placeNameDTO = null;
            placeNameDTO = placeNameDao.Search(79631);
            if (placeNameDTO != null && placeNameDTO.Id == 79631 && placeNameDTO.Name == "Diamon plaza")
            {
                Assert.IsTrue(true);
                return;
            }

            Assert.IsFalse(true);
        }

        /// <summary>
        /// Unit test for GetAllDiaDiemDTO() method in PlaceNameDAO class
        /// </summary>
        [TestMethod]
        public void TestGetAllDiaDiemDTO()
        {
            string connectString = "Data Source = isostore:/Database.sdf";

            PlaceNameDAO serviceDao = new PlaceNameDAO(connectString);
            List<PlaceNameDTO> listServiceDTO = null;
            listServiceDTO = serviceDao.GetAllPlaceNameDTO();
            if (listServiceDTO == null || listServiceDTO.Count == 0)
            {
                Assert.IsFalse(true);
            }

            Assert.IsTrue(true);
        }
    }
}
